package com.llamarun;

import android.graphics.BitmapFactory;
import android.view.View;

public class Duck extends Projectible{
	int i =0;
	int j = 1;
	boolean improved = false;
	
	public Duck(View view)
	{
		this.setBitmap(BitmapFactory.decodeResource(view.getResources(), R.drawable.duck2));
	}
	
	public void improve()
	{
	  improved = true;
	}
	
	public void unimprove(){
	  improved = false; 
	}
	
	public void fly()
	{
		if (improved) {
			//this.setX(this.getX()+speed);
			//this.setY(this.getY()-10*i^(1/8));
			//i+=j;
          if(this.getY()>40) {
		  //this.setX(this.getX()+speed);
		  //this.setY(this.getY()-(i-20)^(1/5));
        	this.setX(this.getX()+speed/2);
    		this.setY(this.getY()-i);
		    i+=j;
          }
          else {
        	  this.setX(this.getX()+speed/2);
          }
		}
		else {
		  this.setX(this.getX()+speed/2);
		  this.setY(this.getY()-i);
		  i+=j;
		}
	}
}
